<!-- 模型中心 -->
<template>
	<div>
		<div class="modelBox" id="domId"></div>
	</div>
</template>

<script>
export default {
	data() {
		return {
			viewToken: 'fd04468c626d4045b50e23a28a68d215'
		}
	},
	created() {
	},
	mounted() {
		var that = this
		// 设置BIMFACE JSSDK加载器的配置信息
		var loaderConfig = new window.BimfaceSDKLoaderConfig()
		loaderConfig.viewToken = that.viewToken
		// 加载BIMFACE JSSDK加载器
		window.BimfaceSDKLoader.load(loaderConfig, that.successCallback, that.failureCallback)
	},
	methods: {
		// 加载成功回调函数
		successCallback(viewMetaData) {
		  // 创建WebApplication，直接显示模型或图纸
		  var dom4Show = document.getElementById('domId')
		  new Glodon.Bimface.Application.WebApplicationDemo(viewMetaData, dom4Show)
		},
		// 加载失败回调函数
		failureCallback(error) {
		  console.log(error)
		},
	}
}
</script>

<style>
.modelBox{
  height: 100%;
}
</style>